<?php
/**
 * Description of UserVideoWidget
 *
 * @author Alexey
 */
class UserVideoWidget extends CWidget {

    public $userId;

    public $count;

    public function init()
    {
        parent::init();
    }

    public function run()
    {
        $videos = VideoFacade::getLatesUserVideo($this->userId, $this->count);
        $videoCount = VideoFacade::getVideoCountByUser($this->userId);
        if (!$videoCount)
        {
            return;
        }
        $this->render('userVideoView', 
            array('videos'     => $videos,
                  'videoCount' => $videoCount
            ));
    }
}
?>
